<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<polymer-element name="ct-commit" attributes="data suspected" noscript>
  <template>
    <style>
      :host {
        display: flex;
        align-items: flex-start;
      }
      :host > * {
        flex-shrink: 0;
      }
      a {
        padding: 5px;
        margin-right: 5px;
        border-radius: 4px;
      }
      div {
        flex: 1;
        padding-top: 5px;
      }
      .suspected-commit {
        color: red;
        font-weight: bold;
      }
      :host(:hover) a {
        background-color: #555;
        color: white;
      }
      :host(:hover) a.suspected-commit {
        background-color: #555;
        color: red;
      }
    </style>
    <template if="{{ suspected }}">
      <span class="suspected-commit">*</span><a class="suspected-commit" href="{{ data.url }}">{{ data.revision }}</a>
    </template>
    <template if="{{ !suspected }}">
      <a href="{{ data.url }}">{{ data.revision }}</a>
    </template>
    <div>{{ data.summary }}<br><em>{{ data.author }}</em></div>
  </template>
</polymer-element>
